fix(installer): resolve race condition and fs detection failure when mounting ESP - #111
fix(installer): resolve race condition and fs detection failure when mounting ESP#111Damian626 wants to merge 3 commits into
Conversation
The PR this lands on describes the fix as `mount -t vfat "$efi_dev"` but the diff only added `udevadm settle` and `sleep 2`, leaving the mount untyped. The waiting is not what addresses the reported failure. When libblkid returns no type — or an ambiguous one, which is what freed space carved out of an existing layout tends to produce — mount(8) falls back to trying every non-nodev type in /proc/filesystems, and on the live ISO squashfs is one of them because the airootfs is a squashfs image. That fallback attempt is the whole of `Can't find a SQUASHFS superblock on nvme0n1p4`, and no amount of settling changes what the probe sees. Three lines above, mkfs.fat -F32 made this partition FAT32, so there is nothing to guess. Naming the type skips the probe, and a genuinely unreadable filesystem now fails as one rather than as a squashfs that was never there. Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
|
Pushed The description's "After" block already has that line, but the diff did not — it added
Two things left for you, neither of which I changed:
The Tests: |
|
Thanks for the detailed feedback! I've resolved the merge conflict. |
|
Re-reviewed at On the race the title names, for the record: there was no window to guard at 775 even before you removed those lines. Naming the type is what changes the outcome, and it does not merely make the probe faster — it removes it. With One thing I could not establish, and would rather say than leave implied. For the untyped mount to fail, that libblkid probe has to come back empty or ambiguous, and I could not reproduce that condition. On util-linux 2.42 I built a loop device carrying a real btrfs filesystem and ran
What ran: Second opinion from codex at xhigh: no defects, and it agreed with the conclusions above — though its independence is not currently guaranteed, as it can read this session's own transcript. Three things it contributed that I had not reasoned about, all verified against the source: the Left to do on your side: the PR closes omacom/omarchy#7263 and omacom/omarchy#7515 and references neither, so neither reporter will find it. A |
|
I was able to edit my configurator to match this PR from root after hitting this bug and get through install. Thanks, @Damian626 |
|
Confirming this fix works. Hit the identical failure on omarchy-4.0.0.iso (built 2026-08-14): free-space install to an external USB SSD (GPT, three existing NTFS partitions, new partitions landing in slots 3/4), encrypted mode. Failed reproducibly 4+ times with mount: /mnt/boot: fsconfig() failed: Can't find a SQUASHFS superblock on sda3 LUKS/btrfs steps all succeeded, and dd-verified the FAT boot sector was correctly written at the partition start, so it's purely a detection failure. Live-patched the configurator to mount -t vfat (plus sync; udevadm settle) and the install completed first try and boots fine. |
|
Re-reviewed at The Two confirmations arrived since (neilcode, ShivanshTiwari613). I checked them against this head rather than taking them at face value, and the detailed one is consistent in every particular the source can check: Those reports also close two things the last review had to leave open. The live ISO boots One caveat on the confirmation itself: ShivanshTiwari613's live patch bundled Nothing was executed this run: the head is unchanged, so the Codex at xhigh reviewed both comments against the source as an independent second opinion. It found nothing that changes the verdict, agreed with the consistency checks above, and added one thing I had not: Merging remains the maintainer's call. |
|
I was preparing to submit this same I independently reproduced and verified the fix on real hardware during a free-space Omarchy installation with two NVMe drives connected. The stock installer created the new 2 GiB FAT32 I changed only the target ESP mount to use So this PR’s explicit |
|
Re-reviewed at What is new is underneath you. On the race in the title. The diff adds no wait, no retry, no barrier — so it is worth being precise about what does establish the ordering, because a retry loop that wins on fast hardware is the usual near-miss here and this is not that. The mechanism, verbatim from @mateo-bolanos — thank you, and your report carries more weight than it may look like. Two reasons. First, every particular of it checks out against this source: the 2 GiB FAT32 Second, and this is the part that matters: you changed only the mount. ShivanshTiwari613's confirmation above bundled What it does not settle, and nothing yet has: why the untyped probe comes back empty or ambiguous in the first place. You reproduced the failure with both drives connected and fixed it with both connected, which does not isolate the second drive as the trigger. Two earlier attempts to reproduce the ambiguity on a loop device failed. The fix is right and is strictly more deterministic than probing either way, but the root cause stays unpinned. On #113, since it is changing how the target is installed and touches ESP handling: it does not collide with this. Textually its only Reviewed by Claude Opus 5 and by Codex at xhigh as a second opinion. Codex found no defects in the six changed lines, and agreed with the ordering argument above — its independence is not currently guaranteed, since its read-only sandbox still let it read the triage protocol this review follows. One thing it added that I had not reasoned about: Nothing pushed, nothing outstanding on your side. |
Summary
Fixes omacom/omarchy#7263
Fixes omacom/omarchy#7515
Fixes an issue where mounting the EFI System Partition (ESP) after formatting fails with exit code 32 when automatic filesystem probing selects an incorrect filesystem type, resulting in a SQUASHFS error in dual-boot setups using free space on the same disk as Windows.
Problem
When the script runs mount "$efi_dev" ... without specifying the filesystem type, mount falls back to automatic filesystem probing. Under certain conditions, this probing can fail or produce an ambiguous result, causing mount to select an incorrect filesystem type and resulting in "Can't find a SQUASHFS superblock on...".
Error:
mount: /mnt/boot: fsconfig() failed: Can't find a SQUASHFS superblock on nvme0n1p4. dmesg(1) may have more information after failed mount system call.mounting the ESP failed (exit 32)Before:
if mount -o ro "$p" "$tmp_mp" 2>/dev/null; thenAfter:
if mount -t vfat -o ro "$p" "$tmp_mp" 2>/dev/null; then